﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage/_FrontEnd_Index.Master" AutoEventWireup="true" CodeBehind="GioHang.aspx.cs" Inherits="MyWeb.GUI.User.GioHang" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script>
        $(function () {
            $('.txtquantity').forceNumeric();


        });
        $.fn.forceNumeric = function () {
            return this.each(function () {
                $(this).keydown(function (e) {
                    var key = e.which || e.keyCode;

                    if (!e.shiftKey && !e.altKey && !e.ctrlKey &&
                        // numbers
                        key >= 48 && key <= 57 ||
                        // Numeric keypad
                        key >= 96 && key <= 105 ||
                        // comma, period and minus, . on keypad
                        key == 190 || key == 188 || key == 109 || key == 110 ||
                        // Backspace and Tab and Enter
                        key == 8 || key == 9 || key == 13 ||
                        // Home and End
                        key == 35 || key == 36 ||
                        // left and right arrows
                        key == 37 || key == 39 ||
                        // Del and Ins
                        key == 46 || key == 45) {
                        $('#lbPhoneError').hide();
                        $('#phonesCus').removeClass('parsley-error');
                        return true;
                    }
                    return false;
                });
            });
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div class="row">

        <div class="span12">
            <table class="table">
                <thead>
                    <tr>
                        <th>
                            <h5>Hình sản phẩm</h5>
                        </th>
                        <th class="desc">
                            <h5>Mô tả</h5>
                        </th>
                        <th>
                            <h5>Số lượng</h5>
                        </th>
                        <th>
                            <h5>Giá sản phẩm</h5>
                        </th>
                        <th>
                            <h5>Thành tiền</h5>
                        </th>
                        <th>
                            <h5>Thao tác</h5>
                        </th>
                    </tr>
                </thead>
                <tbody>
                        <asp:Repeater ID="rpGioHang" runat="server" OnItemCommand="rpGioHang_ItemCommand">
                            <ItemTemplate>
                                <tr>
                                    <td>
                                        <a href="ChiTietSanPham.aspx?MaSP=<%#Eval("MaDienThoai") %>">
                                            <img src="/Content/HinhSanPham/<%#Eval("HinhDaiDien") %>" alt='<%#Eval("TenDienThoai") %>' style="width:92px;height:92px;"></a>
                                    </td>
                                    <td class="desc">
                                        <h4><a href="ChiTietSanPham.aspx?MaSP=<%#Eval("MaDienThoai") %>" class="invarseColor"><%#Eval("TenDienThoai") %>
                                        </a></h4>
                                        <ul class="unstyled">
                                            <li>Tình trạng</li>
                                            <li>Còn hàng</li>
                                        </ul>
                                    </td>
                                    <td class="quantity">
                                        <div class="input-prepend input-append">
                                            <asp:TextBox ID="txtquantity" runat="server" Text='<%#Eval("Quantity") %>' class="tiny-size txtquantity"></asp:TextBox>
                                        </div>
                                    </td>
                                    <td class="sub-price">
                                        <h2><%#Eval("Gia","{0:0,0,0}") %></h2>
                                    </td>
                                    <td class="total-price">
                                        <h2><%#Eval("TongCong","{0:0,0,0}") %></h2>
                                    </td>
                                    <td>
                                        <asp:Button ID="btnupdate" runat="server" class="btn btn-small" rel="tooltip" data-title="Refresh" data-placement="top" CommandArgument='<%#Eval("MaDienThoai") %>' CommandName="update" Text="Cập nhật" />
                                        <asp:Button ID="btndelete" runat="server" class="btn btn-small btn-danger" data-title="Remove" data-placement="top" rel="tooltip" Text="Xóa" CommandArgument='<%#Eval("ProductId") %>' CommandName="delete" />
                                    </td>
                                </tr>
                            </ItemTemplate>
                        </asp:Repeater>
                </tbody>
            </table>
        </div>
        <!--end span12-->
        <div class="span7">
            <div class="cart-accordain" id="cart-acc">

                <div class="accordion-group">
                    <div class="accordion-heading">
                        <a class="accordion-toggle" data-toggle="collapse" data-parent="#cart-acc" href="#estimate">
                            <i class="icon-caret-right"></i>Estimate Shipping &amp; Taxes
                        </a>
                    </div>
                    <div id="estimate" class="accordion-body collapse in">
                        <div class="accordion-inner">
                            <div class="form-horizontal">
                                <div class="control-group">
                                        Bấm vào <a href="TrangChu.aspx" style="text-decoration:none;">đây</a> để tiếp tục chọn mua sản phẩm tại Điện Thoại Online
                                </div>
                                <!--end control-group-->
                            </div>
                        </div>
                </div>
            </div>
            <!--end accordion-group-->
        </div>
        <!--end cart-accordain-->
    </div>
    <!--end span7-->
    <div class="span5">
        <div class="cart-receipt">
            <table class="table table-receipt">
                <tr>
                    <td class="alignRight">
                        <h2>Tổng Cộng</h2>
                    </td>
                    <td class="alignLeft">
                        <h2>
                            <asp:Literal ID="liTotal" runat="server"></asp:Literal>&nbsp;VNĐ</h2>
                    </td>
                </tr>
                <tr>
                    <td class="alignRight">
                    <asp:Button class="btn" ID="btnback" runat="server" Text="Về trang Sản Phẩm" OnClick="btnback_Click" />
                    <td class="alignLeft">
                    <asp:Button class="btn btn-primary" ID="btncheckout" runat="server" Text="Thanh Toán" OnClick="btncheckout_Click" />
                </tr>
            </table>
        </div>
    </div>
    <!--end span5-->


    </div><!--end row-->
</asp:Content>
